package speech.nbc;

import java.util.*;

public class Category {
	
	Tag t;
	HashMap<String, Integer> wordCount;
	int totalWords;
	
	public Category(Tag tt)
	{
		totalWords = 0;
		wordCount = new HashMap<String, Integer>();
		wordCount.clear();
		t = tt;
	}
	
	public void AddWords(ArrayList<String> words)
	{
		for (String w : words)
		{
			if (wordCount.get(w) == null) {
				wordCount.put(w, 0);
			}
			wordCount.put(w, wordCount.get(w) + 1);
			totalWords++;
		}
	}
	
	public Set<String> GetWords()
	{
		return wordCount.keySet();
	}
	
	public int GetWordCount(String word)
	{
		if (wordCount.get(word) == null)
			return 0;
		return wordCount.get(word).intValue();
	}
	
	public int GetTotalWords()
	{
		return totalWords;
	}
}
